import {request} from '@/network/request'

let baseURL = '/api/admin'

// 获取学生列表
export function clientList(data){
    return request({
        url: baseURL + '/student-list',
        method: 'post',
        data: data
    })
}

// 获取表单列表
export function reportFormList(data){
    return request({
        url: baseURL + '/report-list',
        method: 'post',
        data: data
    })
}

// 获取表单详情
export function reportFormDetail(data){
    return request({
        url: baseURL + '/report-detail',
        method: 'get',
        params: data
    })
}

// 删除合同中商品
export function deleteGoodsFromContract(data){
    return request({
        url: '/sale/contract/delete-goods',
        method: 'get',
        params: data
    })
}

// 根据合同ID获取商品列表
export function goodsFromContract(data){
    return request({
        url: '/sale/contract/get-goods-list',
        method: 'get',
        params: data
    })
}

// 合同删除
export function contractDelete(data){
    return request({
        url: '/sale/contract/delete',
        method: 'get',
        params: data
    })
}

// 获取所有合同
export function contractAll(){
    return request({
        url: '/sale/contract/all',
        method: 'get'
    })
}

// 获取合同详情
export function contractInfo(data){
    return request({
        url: '/sale/contract/search',
        method: 'get',
        params: data
    })
}
// 获取所有客户
export function clientAll(){
    return request({
        url: baseURL + '/student-all',
        method: 'get'
    })
}
// 客户删除
export function clientDelete(data){
    return request({
        url: '/sale/client/delete',
        method: 'get',
        params: data
    })
}
// 获取所有销售员
export function salesmanAll(){
    return request({
        url: '/sale/salesman/all',
        method: 'get'
    })
}
// 合同创建
export function contractCreate(data){
    return request({
        url: '/sale/contract/create',
        method: 'post',
        data: data
    })
}
// 合同修改
export function contractUpdate(data){
    return request({
        url: '/sale/contract/update',
        method: 'post',
        data: data
    })
}
// 合同添加商品
export function contractAddGoods(data){
    return request({
        url: '/sale/contract/addGoods',
        method: 'post',
        data: data
    })
}

// 根据ID获取客户
export function clientSearch(data){
    return request({
        url: '/sale/client/search',
        method: 'get',
        params: data
    })
}
// 客户创建
export function clientCreate(data){
    return request({
        url: '/sale/client/create',
        method: 'post',
        data: data
    })
}
// 客户修改
export function clientUpdate(data){
    return request({
        url: '/sale/client/update',
        method: 'post',
        data: data
    })
}
// 获取销售员列表
export function salesmanList(data){
    return request({
        url: '/sale/salesman/list',
        method: 'get',
        params: data
    })
}
// 根据ID获取销售员
export function salesmanSearch(data){
    return request({
        url: '/sale/salesman/search',
        method: 'get',
        params: data
    })
}
// 销售员创建
export function salesmanCreate(data){
    return request({
        url: '/sale/salesman/create',
        method: 'post',
        data: data
    })
}
// 销售员修改
export function salesmanUpdate(data){
    return request({
        url: '/sale/salesman/update',
        method: 'post',
        data: data
    })
}
// 销售员删除
export function salesmanDelete(data){
    return request({
        url: '/sale/salesman/delete',
        method: 'get',
        params: data
    })
}

// 获取采购清单列表
export function purchasingListList(data){
    return request({
        url: '/sale/purchasing-list/list',
        method: 'get',
        params: data
    })
}
// 创建采购清单
export function purchasingListCreate(data){
    return request({
        url: '/sale/purchasing-list/create',
        method: 'post',
        data: data
    })
}
// 根据ID获取采购清单信息
export function purchasingListSearch(data){
    return request({
        url: '/sale/purchasing-list/search',
        method: 'get',
        params: data
    })
}
// 修改采购清单信息
export function purchasingListUpdate(data){
    return request({
        url: '/sale/purchasing-list/update',
        method: 'post',
        data: data
    })
}
// 采购清单执行
export function purchasingListExecute(data){
    return request({
        url: '/sale/purchasing-list/execute',
        method: 'get',
        params: data
    })
}
// 采购清单执行
export function purchasingListDelete(data){
    return request({
        url: '/sale/purchasing-list/delete',
        method: 'get',
        params: data
    })
}
// 给采购清单添加商品
export function purchasingListAddGoods(data){
    return request({
        url: '/sale/purchasing-list/add-goods',
        method: 'post',
        data
    })
}
// 获取采购清单所含商品列表
export function purchasingListGetGoods(data){
    return request({
        url: '/sale/purchasing-list/get-goods',
        method: 'get',
        params: data
    })
}
// 更改采购清单为已付款状态
export function purchasingListChangePaidStatus(data){
    return request({
        url: '/sale/purchasing-list/change-paid-status',
        method: 'get',
        params: data
    })
}
// 删除采购清单商品
export function deleteGoodsFromPurchasingList(data){
    return request({
        url: '/sale/purchasing-list/delete-goods',
        method: 'get',
        params: data
    })
}
// 根据采购清单生成发货单
export function purchasingListGenerateDispatchList(data){
    return request({
        url: '/sale/purchasing-list/generate-dispatch-list',
        method: 'get',
        params: data
    })
}